feat(expo): Add OrganizationSwitcher native component#8589
Draft
chriscanin wants to merge 1 commit into
Draft
Conversation
Bridges the prebuilt OrganizationSwitcher view from clerk-ios and
clerk-android into @clerk/expo/native as a Fabric-codegen-spec'd component.
Mounting <OrganizationSwitcher /> renders the native SwiftUI / Jetpack
Compose switcher inline; tapping presents the platform's native overview /
account-list / manage sheets, including the full OrganizationProfileView
flow (members, domains, invitations, action confirmations) on platforms
where it has shipped.
Bridge surface:
- src/specs/NativeClerkOrganizationSwitcher.ts (Fabric spec)
- src/native/OrganizationSwitcher.tsx (RN wrapper, onOrganizationChanged)
- ios/ClerkOrganizationSwitcherViewManager.{swift,m} + native view class
- android/.../ClerkOrganizationSwitcherViewManager.kt + ExpoView
- Updated ClerkExpo.podspec source_files, ClerkPackage createViewManagers,
and the ClerkViewFactory protocol with createOrganizationSwitcherView()
Depends on upstream native releases not yet shipped:
- clerk-ios: PR #411 (sean/mobile-487-ios-prebuilt-org-views) must merge
- clerk-android: 1.0.17 must be tagged (#628-#638 merged to main, no release)
🦋 Changeset detectedLatest commit: fa22bbe The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new
<OrganizationSwitcher />native component to@clerk/expo/native, bridging the prebuilt organization-switcher views fromclerk-iosandclerk-androidinto React Native via the same Fabric / Expo native module pattern that already powers<AuthView />and<UserProfileView />.Mounting
<OrganizationSwitcher />:OrganizationProfileViewflow (members, domains, invitations, action confirmations) on platforms where it has shippedonOrganizationChangedfires on active-org change so JS consumers can refetchuseOrganization()Bridge surface
packages/expo/src/specs/NativeClerkOrganizationSwitcher.ts— Fabric codegen specpackages/expo/src/native/OrganizationSwitcher.tsx— RN wrapper, emitsonOrganizationChangedpackages/expo/ios/ClerkOrganizationSwitcherViewManager.{swift,m}+ native view class inClerkExpoModule.swiftpackages/expo/android/.../ClerkOrganizationSwitcherViewManager.kt+ClerkOrganizationSwitcherExpoView.ktClerkExpo.podspec(source files),ClerkPackage.kt(registered manager), andClerkViewFactory.swift(newcreateOrganizationSwitcherViewfactory method)This component depends on native SDK code that is merged but not yet released:
clerk-iossean/mobile-487-ios-prebuilt-org-views— still OPEN, mergeable, all CI green. Needs merge + tagged release.clerk-androidmain2026-05-13 .. 2026-05-16.mainis 19 commits ahead of v1.0.16 — needs a v1.0.17 release tag.The
clerkAndroidApiVersion/clerkAndroidUiVersionpins inpackages/expo/android/build.gradleare set to1.0.17ahead of the tag — consumer builds will fail to resolve until the release ships. Same on iOS: until #411 lands and a release ships,ClerkKitUI.OrganizationSwitcherwon't exist for the consumer's SPM resolution.This PR should land in lock-step with (or after) the native releases. Bump the pins to the actual tagged versions before un-drafting.
Test plan
Verified end-to-end against unreleased native code in
clerk-expo-quickstart/NativeComponentQuickstart:sean/mobile-487-ios-prebuilt-org-viewsbranch.<OrganizationSwitcher />renders inline, opens overview sheet on tap, "Manage" routes to OrganizationProfileView with members/domains/invites.main(post-Shared package has unnecessary peer dependency onreact-test-renderer#638) to mavenLocal as1.0.17-LOCAL, pinned the bridge to match. Same switcher behavior; sheet now includes Manage button after Embed Clerk React components to site with root's element font-size 1px; #633's iOS-parity work.Checklist
pnpm buildpasses (tsup + tsc declarations)pnpm lintclean on changed filespnpm test— n/a, no JS-only logic worth unit testing; verified in quickstart end-to-endOrganizationSwitcher+OrganizationSwitcherPropschris/docs-expo-organization-switcher(not opened). Native iOS/Android docs don't exist yet either; will land when they do.Type of change
Follow-up
<OrganizationProfileView />once both natives ship publicly — for apps that want a dedicated org-settings screen rather than driving everything through the switcher's modal sheet.